package com.ws.client;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;

import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Service;

public class ProxyServiceLocator extends Service implements ProxyService {

	  //private String ProxyPort_address = "http://140.207.82.206:5003/webService/ProxyService";//外网
	  private String ProxyPort_address = "http://188.68.88.102:7005/webService/ProxyService";//内网
	  private String ProxyPortWSDDServiceName = "ProxyPort";
	  private HashSet ports = null;
	  
	@Override
	public String getProxyPortAddress() {
	
		return this.ProxyPort_address;
	}

	@Override
	public Proxy getProxyPort() throws ServiceException {
		
		URL endpoint;
	    try {
	      endpoint = new URL(this.ProxyPort_address);
	    }
	    catch (MalformedURLException e)
	    {
	      throw new ServiceException(e);
	    }
	    return getProxyPort(endpoint);
	}

	@Override
	public Proxy getProxyPort(URL portAddress) throws ServiceException {
		   try {
			   ProxyPortBindingStub _stub = new ProxyPortBindingStub(portAddress, this);
			      _stub.setPortName(getProxyPortWSDDServiceName());
			      return _stub;
			    } catch (org.apache.axis.AxisFault _stub) {
			    }
		return null;
	}

	  public String getProxyPortWSDDServiceName()
	  {
	    return this.ProxyPortWSDDServiceName;
	  }

	  public void setProxyPortWSDDServiceName(String name) {
	    this.ProxyPortWSDDServiceName = name;
	  }

}
